<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改用户</title>
<link href="/res/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/res/js/jquery.js"></script>
<script type="text/javascript" src="/res/js/lib/formvalid/FormValid.js"></script>
<link href="/res/js/lib/layer/skin/layer.css" rel="stylesheet" type="text/css" />
<link href="/res/js/lib/layer/skin/layer.ext.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/res/js/lib/layer/layer.js"></script>
<script type="text/javascript" src="/res/js/common/msgTools.js"></script>
<script type="text/javascript" src="/res/js/pages/merchant/merchantEdit.js"></script>
<script type="text/javascript" src="/res/js/common/regionSelect.js"></script>
<script type="text/javascript" src="/res/js/jquery.idTabs.min.js"></script>
<link rel="stylesheet" href="/res/js/lib/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/res/js/lib/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="/res/js/lib/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="/res/js/lib/kindeditor/lang/zh-CN.js"></script>
<script charset="utf-8" src="/res/js/lib/kindeditor/plugins/code/prettify.js"></script>

<style>
body{width:780px;min-width:780px!important;}
.uew-select {
    display: block;
    float: left;
    margin-right:10px;
}

.rightinfo {
    border: 1px solid #efefef;padding:3px;margin:0px 0px 3px 0px;;
    background: #efefef;
}    
select{border:1px solid #ccc;font-size:14px;line-height: 26px;padding:3px;}
.table-img td{padding:5px 0px;vertical-align:top;}
</style>


<script type="text/javascript">
    $(function(){$("#usual1 ul").idTabs();});
    var editor=null;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="traderDesc"]', {
			cssPath : '/res/js/lib/kindeditor/plugins/code/prettify.css',
			uploadJson : '/res/js/lib/kindeditor/jsp/upload_json.jsp',
			fileManagerJson : '/res/js/lib/kindeditor/jsp/file_manager_json.jsp',
			allowFileManager : true,
			afterCreate : function() {
				var self = this;
				K.ctrl(document, 13, function() {
					self.sync();
					document.forms['queryForm'].submit();
				});
				K.ctrl(self.edit.doc, 13, function() {
					self.sync();
					document.forms['queryForm'].submit();
				});
			},
		   afterChange : function(){
			   this.sync();			   
		   }
		   });
		prettyPrint();
	});
</script>
</head>

<body style="overflow-x:hidden;">
	<div class="formbody">

		<form id="queryForm" action="/merchant/edit/save" method="post" enctype="multipart/form-data" onsubmit="return checkData(this)">


    <div class="rightinfo">
    	<ul class="toolbar" style="margin-left:20px;float: right; " >
	        <li onclick="$('#queryForm').submit()"><span><img src="/res/images/t02.png" /></span>保存</li>
        </ul>
        <div style="clear:both;"></div>    
    </div>
	<div style="clear:both;"></div>
	<div id="usual1" class="usual"> 
    
    <div class="itab">
  	<ul> 
    <li><a href="#tab1" class="selected">商户基本资料</a></li> 
    <li><a href="#tab2">商户证照</a></li> 
  	</ul>
    </div> 		
			<div id="tab1" class="tabson">
				<input type="hidden" name="id" value="${merchant.id }"/>
				
				<ul class="forminfo">				
					<li><label>商户简称<b></b></label>
					    <input name="name" value="${merchant.name}" type="text" class="dfinput" style="width:150px;" />
					    <span id="errMsg_name" class="errMsg">商户全称为2~30个字符</span> 
					</li>
					<li><label>商户全称<b>*</b></label>
                        <input name="merchantName" value="${merchant.merchantName}" valid="required" type="text" class="dfinput" style="width:150px;" />
					    <span id="errMsg_merchantName" class="errMsg">商户全称为2~50个字符</span> 
					</li>
					<li><label>手机号<b>*</b></label> <input name="mobile" value="${merchant.mobile}" valid="required"  max="11" min="11" type="text" class="dfinput" style="width:150px;" />
					    <span id="errMsg_mobile" class="errMsg">请输入手机号</span>					
					</li>
					<li><label>所属地区<b>*</b></label> 
						<div id="dvRegion" class="vocation" style="display:block;float:left; white-space: nowrap;">
							<select name="province" width="130"> 
							   <option value="">==请选择省份==</option>
							   <c:forEach items="${provList}" var="pro">
							      <option value="${pro.id}" ${merchant.province==pro.id?"selected":""}>${pro.name}</option>
							   </c:forEach>
							</select>

							<select name="city" width="130">
							   <option value="">==请选择城市==</option>
							   <c:forEach items="${cityList}" var="city">
							      <option value="${city.id}" ${merchant.city==city.id?"selected":""}>${city.name}</option>
							   </c:forEach>							
							</select>

							<select name="area" width="130">
							   <option value="">==请选择县区==</option>
							   <c:forEach items="${areaList}" var="area">							      
							      <option value="${area.id}" ${merchant.area==area.id?"selected":""}>${area.name}</option>
							   </c:forEach>							
							</select>
						</div>		
					</li>
					<li><label>经度<b></b></label> <input name="longitude" value="${merchant.longitude}" valid="isNumber"  type="text" class="dfinput" style="width:150px;" />
					    <span id="errMsg_longitude" class="errMsg">经度为数字类型</span>					
					</li>
					<li><label>续度<b></b></label> <input name="latitude" value="${merchant.latitude}" valid="isNumber"  type="text" class="dfinput" style="width:150px;" />
					    <span id="errMsg_latitude" class="errMsg">续度为数字类型</span>					
					</li>
 					<li><label>宣传口号</label> <input name="slogan" value="${merchant.slogan}" type="text" class="dfinput" maxlength="150" style="width:400px;" ></input></li>
 					<li><label>证件号</label> <input name="certificateNum" value="${merchant.certificateNum}" type="text" class="dfinput" maxlength="50" style="width:400px;" ></input></li>
 					<li><label>联系人</label> <input name="linkman" value="${merchant.linkman}" type="text" class="dfinput" maxlength="30" style="width:400px;" ></input></li>															
 					<li><label>详细地址</label> <input name="address" value="${merchant.address}" type="text" class="dfinput" style="width:150px;" ></input>
					</li>	 				
					<li><label>经营项目<b>*</b></label>
						<div class="vocation">
							<select name="category" width="130">
							   <option value="">==请选择商家类型==</option>
							   <c:forEach items="${cateList}" var="cat">							      
							      <option value="${cat.id}" ${merchant.category==cat.id?"selected":""}>${cat.name}</option>
							   </c:forEach>							
							</select>							
						</div>
					</li>
 					<li><label>商家描述</label></li>
 					<li>	
						<div style="clear:both;"></div>					    
					    <textarea name="traderDesc" style="width:710px;height:300px;">${merchant.traderDesc}</textarea>
					    <div style="clear:both;"></div>						    				    					    
					</li>							
				 </ul>	
			</div>
			
			<div id="tab2" class="tabson">
			    <table class="table-img">
			       <tr>
			          <td>商铺封面照小图(150x150)</td>
			          <td>					    
					    <c:if test="${!empty(merchant.imgCoverSmall)}">
					    <label>&nbsp;</label><a href="${merchant.imgCoverSmall}" target="_blank"><img src="${merchant.imgCoverSmall}" width="142" height="80"/></a><br/>
					    </c:if>
					    <input type="file" name="upimgCoverSmall" class="dfinput" style="width:350px;"/>			          
			          </td>
			       </tr>			    
			       <tr>
			          <td>商铺封面照大图</td>
			          <td>					    
					    <c:if test="${!empty(merchant.imgCover)}">
					    <label>&nbsp;</label><a href="${merchant.imgCover}" target="_blank"><img src="${merchant.imgCover}" width="360" height="198"/></a><br/>
					    </c:if>
					    <input type="file" name="upimgCover" class="dfinput" style="width:350px;"/>			          
			          </td>
			       </tr>			       			    
			       <tr>
			          <td>身份证正面</td>
			          <td>
					    <c:if test="${!empty(merchant.idcardA)}"> 
					      <label>&nbsp;</label><a href="${merchant.idcardA}" target="_blank"><img src="${merchant.idcardA}" width="360" height="198"/><br/>
					    </c:if>
					    <input type="file" name="upimgIdcadA" class="dfinput" style="width:350px;"/>			          
			          </td>
			       </tr>
			       <tr>
			          <td>身份证反面</td>
			          <td>					    
					     <c:if test="${!empty(merchant.idcardB)}"> 
					       <label>&nbsp;</label><a href="${merchant.idcardB}" target="_blank"><img src="${merchant.idcardB}" width="360" height="198"/></a><br/>
					     </c:if> 
					     <input type="file" name="upimgIdcadB" class="dfinput" style="width:350px;"/>			          
			          </td>
			       </tr>
			       <tr>
			          <td>营业执照</td>
			          <td>					    
					    <c:if test="${!empty(merchant.certificate)}"> 
					      <label>&nbsp;</label><a href="${merchant.certificate}" target="_blank"><img src="${merchant.certificate}" width="360" height="198"/></a><br/>
					    </c:if>
					    <input type="file" name="upimgCert" class="dfinput" style="width:350px;"/>			          
			          </td>
			       </tr>			       			       			       
			    </table>
			</div>
	   </div>
		</form>
	</div>
	${actionMsg}
</body>

</html>


